package com.itheima.功能流.properties;


import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class PropertiesDemo3 {
    public static void main(String[] args) throws IOException {
        //void load(Reader reader)                      //将本地文件中的键值对加载进内存
        //读取
        //read();

        //void store (Writer writer, String comments)   //将集合中的数据以键值对形式保存在文件中
        Properties prop = new Properties();
        prop.put("zhangsan","123");
        prop.put("lisi","456");
        prop.put("wangwu","789");

        FileWriter fw = new FileWriter("day13_IO流_功能流\\prop.properties");
        prop.store(fw,"usermsg");

    }

    private static void read() throws IOException {
        Properties prop = new Properties();
        FileReader fr = new FileReader("day13_IO流_功能流\\prop.properties");

        prop.load(fr);

        System.out.println(prop);
    }
}
